package system;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;


public class L {
	public static Logger console;
	public static Logger file;
	
	public static void config() {
    	console = Logger.getLogger("console");
    	file = Logger.getLogger("file");
    	PropertyConfigurator.configure("log4.properties");
    	console.fatal("server start log");
    	file.fatal("server start log");
	}
	
	public static void debug(String str) {
		log(Level.DEBUG, str); 	
	}
	
	public static void warn(String str) {
		log(Level.WARN, str); 	
	}
	
	public static void error(String str) {
		log(Level.ERROR, str);
	}
	
	public static void info(String str) {
		log(Level.INFO, str);
	}
	
	public static void log(Level level, String str) {
		console.log(level, str);
		file.log(level, str);
	}

}
